package com.hzmall.util;

import com.hzmall.pojo.User;

import javax.servlet.http.HttpServletRequest;

public class CheckLoginUtil {
    public static User doCheckLogin(HttpServletRequest request){
        String token = CookieUtil.readCookie(request);
        String userStr = RedisShardedPoolUtil.get(token);
        User user = JsonUtil.string2Obj(userStr, User.class);
        if (user != null){
            return user;
        }
        return null;
    }

}
